#pragma once
#include <iostream>
#include "Observer.h"
using namespace std;

class Underpan : public Observer{
public:
    
    void update(Subject *subject){
        act_of_state=subject->getState();
        cout<<"障碍物在"<<state_of_obstacle[act_of_state]<<",应该进行："<<action[act_of_state]<<endl;
    }
private:
    int act_of_state;
    string action[3]={"后退","左转","右转"};
    string state_of_obstacle[3]={"前方","右前方","左前方"};
};